﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>获取kml的测试</title>
</head>

<body>

    <div>

        <button id="btn_T" type="button" onclick="LoadText();" style="width:120px;height:30px;" ></button>

    </div>


    <script src="scripts/exlib/jquery.min.js" type="text/javascript"></script>

    <script type="text/javascript">

        ///<reference path='scripts/exlib.jquery.min.js'/>

        //$('#btn_T').click(function ()
        //{
        //    //var url = 'AjaxTest.ashx';
        //    //var url = "2012-02-10.kml";
        //    var url = '2012.text';
        //    $.get(url, function (evt, state)
        //    {
        //        alert(evt);
        //    });
        //});


        var xmlhttp;

        function LoadText()
        {
            if (xmlhttp == undefined)
            {
                if (window.XMLHttpRequest)
                {
                    xmlhttp = new XMLHttpRequest();
                }
                else
                {
                    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
                }

            }
            xmlhttp.onreadystatechange = function (ev)
            {

                if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
                {
                    //document.getElementById("rnode").innerHTML = xmlhttp.responseText;
                    alert('secussed');
                }
                else if (xmlhttp.readyState == 4 && xmlhttp.status == 404)
                {
                    alert("error");
                }
            }
            var url1 = 'AjaxTest.ashx';
            var url2 = "2012-02-10.kml";
            var url3 = '2012.txt';
            xmlhttp.open("GET",url2, true);
            xmlhttp.send();





            //var today = new Date();
            //var h = today.getHours();
            //var m = today.getMinutes();
            //var s = today.getSeconds();
            //m = checkTime(m);
            //s = checkTime(s);
            //document.getElementById("rnode").innerHTML = h + ":" + m + ":" + s;

        }



    </script>

</body>

   


</html>
